<!--作者QQ53461569-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css">
  <title>龙钞靓号检测系统</title>
</head>
<body>
<div class="container">
  <div class="row mt-4">
    <div class="col-md-6 offset-md-3">
      <h1 class="text-center">龙钞靓号检测系统</h1>
    </div>
  </div>

  <div class="row mt-4">
    <div class="col-md-6 offset-md-3">
      <div class="form-group">
        <div class="input-group mb-3">
          <div class="input-group-prepend">
            <span class="input-group-text" id="basic-addon1">J</span>
          </div>
          <input type="text" class="form-control" id="cpnum" placeholder="请输入首钞票号"  aria-describedby="basic-addon1">
        </div>
      </div>
      <div class="form-group">
        <select class="form-control" id="num">
          <option value="1">单张</option>
          <option value="20">二十连</option>
          <option value="100">百连</option>
        </select>
      </div>
      <button type="button" class="btn btn-primary btn-block" onclick="start()">开始检测</button>
      <button type="button" class="btn btn-secondary btn-block" onclick="toExcel()">导出结果</button>
    </div>
  </div>
  <div class="row mt-4">
    <div  class="col-md-6 offset-md-3">
      <table class="table table-bordered" id="data" style="display: none" border=“1”>
        <thead>
        <tr>
          <th scope="col">序号</th>
          <th scope="col">钞票号</th>
          <th scope="col">是否靓号</th>
        </tr>
        </thead>
        <tbody>
        </tbody>
      </table>
    </div>
  </div>
</div>
<footer class="text-center">
  <p>版权所有 &copy; 2024 AnlgerS &nbsp; <a href="https://danran0.cc/post/21.html">反馈&建议</a> </p>
</footer>

<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.0/jquery.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/layer/3.5.1/layer.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.5.0/js/bootstrap.min.js"></script>
<script>
  function checkNum(e){
    var n = [];
    e.slice(-8).match(/^(?:1976|1988|2000|2012|2024)(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$/) ? n.push("龙年生日号"):e.slice(-8).match(/^(\d{4})(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$/) ? n.push("生日号"): n;
    /5201314$/.test(e) ?n.push("顶级爱情号"):/520$|1314$/.test(e) ? n.push("爱情号") :n;
    /(\d)\1{7}$/.test(e) ? n.push("麒麟号"):/(\d)\1{6}$/.test(e) ? n.push("恐龙号"):/(\d)\1{5}$/.test(e) ? n.push("大象号"):/(\d)\1{4}$/.test(e) ? n.push("老虎号"):/(\d)\1{3}$/.test(e) ? n.push("狮子号"):/(\d)\1{2}$/.test(e) ? n.push("豹子号"):n;
    /^0000/.test(e) ? n.push("0000头"):n;
    /^1111/.test(e) ? n.push("火箭头"):n;
    /^[01689]+$/.test(e) ? n.push("倒置号"):n;
    /^[0689]+$/.test(e) ? n.push("圆圆号"):n;
    /2024$/.test(e) ? n.push("2024尾"):n;
    /^2024/.test(e) ? n.push("2024头"):n;
    var sz = new Set(e).size;
    sz === 4 ?  n.push("龙四"):n;
    sz === 3 ?  n.push("龙三"):n;
    sz === 2 ?  n.push("龙二"):n;
    /^[08]+$/.test(e) ? n.push("08组合"):n;
    /^[68]+$/.test(e) ? n.push("68组合"):n;
    /^[168]+$/.test(e) ? n.push("168组合"):n;
    /^[01]+$/.test(e) ? n.push("二进制号"):n;
    /^\d+$/.test(e) ? e === e.split("").reverse().join("") && n.push("雷达号"):n;
    /(12345|23456|34567|45678|56789)/.test(e) ? n.push("顺子号"):n;
    /(54321|65432|76543|87654|98765)/.test(e) ? n.push("倒顺子"):n;
    /^(?!.*(.).*\1)[0-9]{7,}$/.test(e) ? e.length >= 7 && n.push("乱蛇号"):n;
    /^[^47]*$/.test(e) ?n.push("无47"):n;
    /^[^3457]*$/.test(e) ?n.push("朦胧号"):n;
    return n.length>0?n.join(","):"普通";
  }
  function start(){
    var cpnumStr = $('#cpnum').val();
    if(cpnumStr === undefined || cpnumStr === null || cpnumStr.length !== 9){
      layer.msg("请输入正确9位龙钞编号");
      return;
    }
    if(!/^[0-9]+$/.test(cpnumStr)){
      layer.msg("请输入数字");
      return;
    }
    var tab = $('#data tbody');
    tab.empty(); // 清空表格内容
    var num = parseInt($('#num').val());
    var cpnum = parseInt(cpnumStr);
    // 通过循环添加表格行
    for (var i = 0; i < num; i++) {
      var row = '<tr><th scope="row">'+(i+1)+'</th><td>' + (cpnum+i).toString().padStart(9, "0") + '</td><td>' + checkNum((cpnum+i).toString().padStart(9, "0")) + '</td></tr>';
      tab.append(row);
    }
    $('#data').show(); // 显示表格
    layer.msg("检测完成，结果仅供参考有BUG请点击页面下方链接反馈");
  }
  //导出excel
  function toExcel(){
    var exportFileContent = document.getElementById("data").outerHTML;
    var blob = new Blob([exportFileContent], {type: "text/plain;charset=utf-8"});     	//解决中文乱码问题
    blob =  new Blob([String.fromCharCode(0xFEFF), blob], {type: blob.type});
    var link = window.URL.createObjectURL(blob);
    var a = document.createElement("a");
    a.download = "导出数据.xls";
    a.href = link;
    document.body.appendChild(a);
    a.click();
    document.body.removeChild(a);
  }

</script>
<script>
  var _hmt = _hmt || [];
  (function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?dc2cbffde26d37584072b2ec12883448";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
  })();
</script>

</body>
</html>
